#pragma once

// Dependencies
class Polygon2;
#include "Point2.h"
#include <deque>

class Tessellator {
private: // Types
	class Client;
	struct Job;

public: // Constructors
	Tessellator();
	~Tessellator();

public: // Methods
	void tessellate( Polygon2& p );
	void reset();

private: // Methods
	void beginPolygon( Job& j );
	void endPolygon();
	void beginContour();
	void endContour();
	void vertex( const Point2& vec );
	
private: // Non-copyable
	Tessellator( const Tessellator& );
	Tessellator& operator = ( const Tessellator& );

private: // Members
	class GLUtesselator* mTess;
	std::deque<Point2> mInputVertices;
};